#pragma once
#ifndef BEZIERPATH_H
#define BEZIERPATH_H
#include <tsg.h>
#include <vector>

using namespace std;
using namespace tsg;
using namespace gl;



//for the continuity between two bezier path, the two last points of the previous path and the two first points of
//the next path need to be aligned.
class bezierPath : public Controller2
{
private:
	class controllerPoint
	{
	public:
		Vector3 position;
		float time;

	public:
		controllerPoint();
		controllerPoint(Vector3 position, float time);
	};
public:
	vector<controllerPoint> vectorControllerPoint;
	Parameter<Vector3> position;
	Parameter<Vector3> firstDerivative;
	Parameter<Vector3> secondDerivative;
	Parameter<float> time;
	int currentControllerPoint;
	bool m_loop;
private:
	int n_numberOfLoop;
	float m_relativeTime;
	bool m_firstLoop;
	
public:
	bezierPath();
	void addControllerPoint(Vector3 position1, float time1, Vector3 position2, float time2, 
									Vector3 position3, float time3, Vector3 position4, float time4);
private:
	void doUpdate();
	

};


#endif
